package com.example.importtest.selector;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * 实现 ImportSelector#selectImports，返回需要装配的类的名称
 *
 * @author yanzhao
 * @date 2022/5/9 10:59
 * @since 1.0.0
 */
public class BeanImportSelector implements ImportSelector {

    /**
     * 自动装配注册bean到IOC容器
     *
     * @param importingClassMetadata
     * @return
     */
    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
        return new String[]{
                BeanConf.class.getName()
        };
    }
}
